from rest_framework.serializers import ModelSerializer
from .models import *
from rest_framework import serializers  #普通序列化器



#新闻
class MNewSer(ModelSerializer):
    class Meta:
        model = MNew
        fields = '__all__'

#广告
class MadvertisingmanageSer(ModelSerializer):
    class Meta:
        model = Madvertising
        fields = '__all__'

#美多开始

#注册用户
class CreatCaptchaSer(ModelSerializer):
    class Meta:
        model = User
        fields = '__all__'

# 添加地址
class AddressSer(ModelSerializer):
    class Meta:
        model = Address
        fields ='__all__'

class ShowAddressSer(ModelSerializer):
    user=serializers.StringRelatedField()
    receive=serializers.StringRelatedField()
    province=serializers.StringRelatedField()
    city=serializers.StringRelatedField()
    area=serializers.StringRelatedField()
    class Meta:
        model = Address
        fields ='__all__'

# 区域
class AreaSer(ModelSerializer):
    class Meta:
        model = Area
        fields ='__all__'


